/**
 * @file Xados.hpp
 */
#ifndef __XADOS_HPP__
#define __XADOS_HPP__

#include <qcheckbox.h>
#include <qdialog.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qevent.h>

#include <BrowserWidget.hpp>
#include <ConfigManager.hpp>
#include <defines.h>
#include <ExtendedQLabel.hpp>
#include <HelpDialog.hpp>
#include <MBListener.hpp>

class Xados : public QDialog {
	Q_OBJECT
	protected:
		/**
		 * Logotype
		 */
		QLabel*	_logo;
		/**
		 * Buttons
		 * @{
		 */
		QPushButton*	_closeButton;
		QPushButton*	_consoleButton;
		QPushButton*	_helpButton;
		QPushButton*	_editButton;
		QPushButton*	_macroButtons[XADOS_CONF_MBUTTON_COUNT];
		MBListener*	_macroButtonsListeners[XADOS_CONF_MBUTTON_COUNT];
		/** @} */
		QCheckBox*	_checkBoxes[XADOS_CONF_CBOXES_COUNT];
		ExtendedQLabel*	_checkBoxesLabels[XADOS_CONF_CBOXES_COUNT];
		BrowserWidget*	_browser;
		HelpDialog*	_help;

		bool		_largeSize;
		QSize		_bakSize;
		ConfigManager*	_config;

	public:
		Xados(ConfigManager* config);
		virtual ~Xados();

	protected:
		virtual void closeEvent(QCloseEvent* event);
		virtual void loadBrowser();
		virtual void loadCheckBoxes();
		virtual void loadMacroButtons();
		virtual void mouseDoubleClickEvent(QMouseEvent *e);
		virtual int runCommand(const string &command);

	public slots:
		virtual void catchCheckBoxChange(int);
		virtual void runMacroButtonAction(int buttonNumber);
		virtual void toggleSize();

	signals:
		void closed();
		void logoClicked();
};

#endif /* __XADOS_HPP__ */
